﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/External.Master" Inherits="System.Web.Mvc.ViewPage<BPM.ViewModel.LogonViewModel>" %>

<asp:Content ID="c1" ContentPlaceHolderID="TitleContent" runat="server">
	登录
</asp:Content>
<asp:Content ID="c3" ContentPlaceHolderID="ScriptStyleContent" runat="server">
	<script type="text/javascript">
		$("#tableLogin").ready(function () {
			//Below are used to let left td align right and right td align left, and control width for all TDs
			$("tr td:nth-child(1)").css({ "text-align": "right", "width": "120px" });
			$("tr td:nth-child(2)").css({ "text-align": "left", "width": "160px" });
			$("tr td:nth-child(3)").css({ "text-align": "left", "width": "220px" });

			//register Input control FocusIn event handler
			$("#tableLogin input").focus(function () {
				//clear others
				$("#tableLogin input").each(function () {
					if ($(this).attr("name") != "validationCode") {
						$(this).parent().next().hide();
					}
					$(this).parent().parent().css("background-color", "");
				});
				//register mine
				//if validationCode, don't hide third TD
				if ($(this).attr("name") != "validationCode") {
					$(this).parent().next().show();
				}
				$(this).parent().parent().css("background-color", "#EEE");
			}).first().focus();
		});
	</script>
</asp:Content>
<asp:Content ID="c2" ContentPlaceHolderID="MainContent" runat="server">
	<% using (Html.BeginForm())
	{ %>
	<div>
		<fieldset style="width: 500px; margin-left: 250px; margin-top: 50px;">
			<legend>登录</legend>
			<table id="tableLogin" style="width: 500px;" cellpadding="0" cellspacing="0">
				<tr>
					<td>
						用户名:&nbsp;
					</td>
					<td>
						<% if (Model == null || String.IsNullOrWhiteSpace(Model.UserName))
		 { %>
						<input type="text" name="userName" style="width: 150px;" value="" />
						<%}
		 else
		 { %>
						<input type="text" name="userName" style="width: 150px;" value="<%= Model.UserName %>" />
						<%} %>
					</td>
					<td id="tdInfoUserName" style="display: none;">
						忘记用户名,<a href="">点击这里</a>
					</td>
				</tr>
				<tr>
					<td>
						密码:&nbsp;
					</td>
					<td>
						<input type="password" name="password" value="1" style="width: 150px;" />
					</td>
					<td id="tdInfoPwd" style="display: none;">
						忘记密码,<a href="">点击这里</a>
					</td>
				</tr>
				<%--<tr>
                    <td>
                        验证码:&nbsp;
                    </td>
                    <td>
                        <input type="text" name="validationCode" style="width: 150px;" />
                    </td>
                    <td>
                        <img src="<%= Url.Content("~/Images/validationCode.jpg") %>" alt="验证码" />
                        <a href="#" onclick="return false;">换一张</a>
                    </td>
                </tr>--%>
				<% if (Model != null && !String.IsNullOrWhiteSpace(Model.Message))
	   { %>
				<tr>
					<td colspan="2" class="validError">
						<%= Model.Message%>
					</td>
				</tr>
				<%} %>
			</table>
			<div style="width: 100%; height: 30px; line-height: 30px; text-align: center;">
				<input type="submit" value="登录" />
				<input type="button" value="注册" onclick="window.location.href = '../Register/Register';" />
			</div>
		</fieldset>
	</div>
	<%} %>
</asp:Content>
